package io.github.wanggit.website.demos.zipkin_service_4.service;

import io.github.wanggit.antrpc.commons.test.WaitUtil;
import io.github.wanggit.website.demos.zipkin_service_4.dao.PersonRepository;
import io.github.wanggit.website.demos.zipkin_service_4.domain.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class TestTraceServiceImpl implements TestTraceService {

    @Autowired
    private PersonRepository personRepository;

    @Override
    public String testTrace(String content) {
        return readMe() + content;
    }

    @Override
    public String readMe(){
        return "Label Me:";
    }

    @Override
    public List<Person> listPersons(){
        return personRepository.findAll();
    }
}
